package lihua.robot;

import lihua.robot.utils.ApplicationContextUtil;
import lihua.robot.utils.DetectOrdersUtil;
import lihua.robot.utils.MqttUtil;
import lihua.robot.utils.RedisUtil;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

@EnableScheduling
@EnableAsync
@MapperScan("lihua.robot.mapper")
@SpringBootApplication
public class SchedulingRobotApplication {

    public static void main(String[] args) {
        ApplicationContext applicationContext = (ApplicationContext) SpringApplication.run(SchedulingRobotApplication.class, args);
        ApplicationContextUtil.setApplicationContext(applicationContext);
        RedisUtil.Initialization();
        RedisUtil.InitializationXS();
//        MqttUtil.runMQTT();
        DetectOrdersUtil.runDetectOrder();
    }

}
